const {Course} = require('../../mongodb/models')

module.exports =[
    {
        path:'/test',
        method:'get',
        process: async (ctx, next) => {
					const {page=1, pageSize=10, userId, categoryId} = ctx.query
					var doc = await Course.find({category:categoryId})
					.populate('category', 'name type')
					ctx.response.body = {
						errCode: doc ? 0 : 10001,
						errMsg: doc ? 'request:success' : '用户名或密码错误',
						data: doc
					}
        }
    }
]